<!doctype html>
<html lang="en">
<head>
    <title>表单验证</title>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script>
        window.hdjs = {};
        window.hdjs.base = '/hdjs';
        window.hdjs.uploader = 'php/uploader.php?';
        window.hdjs.filesLists = 'php/filesLists.php?';
    </script>
    <script src="../dist/static/requirejs/require.js"></script>
    <script src="../dist/static/requirejs/config.js"></script>
</head>
<body style="padding: 50px;">
<form action="" method="post" class="form-horizontal" id="registration-form">
    <div class="form-group">
        <label class="col-sm-2 control-label">邮箱</label>
        <div class="col-sm-10">
            <input data-validation="email" data-validation-error-msg="请输入邮箱">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">帐号</label>
        <div class="col-sm-10">
            <input data-validation="custom" data-validation-regexp="^[a-z]{3,}$"
                   data-validation-error-msg="用户名由3位以上字母构成">
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-10 col-sm-offset-2">
            <button class="btn btn-primary">保存</button>
        </div>
    </div>
</form>
<script>
    require(['hdjs'], function (hdjs) {
        $.validate();
    });
</script>
</body>
</html>